package com.multiple.datasource.controller.primary;

import com.multiple.datasource.service.primary.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/user")
public class UserController {
    @Autowired
    UserService userService;

    @ResponseBody
    @RequestMapping(value="/detail")
    public Object userDetail(@RequestParam int id){
        return userService.getUserById(id);
    }
}
